import Vue from 'vue'
import VueRouter from 'vue-router'
// 登录页
import Login from '../views/Login.vue'
// 访问页
import Layout from '../views/Layout.vue'
// 后台
import Before from '../views/Before.vue'
// 学生
// 题目列表
import list from '../views/student/list.vue'
// 发布
import gai from '../views/student/gai.vue'
// 精选
import Jing from '../views/student/Jing.vue'
// 发布论题
import fabu from '../views/fabu/fabu.vue'
// 题目列表
import userlist from '../views/userlist/list.vue'
// 发布
import usergai from '../views/userlist/gai.vue'
// 个人中心
import user from '../views/User/user.vue'

// test页
import Test from '../views/Test/test.vue'
// page404
import page404 from '../page404/404.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    component: Login
  },
  {
    path: '/layout',
    component: Layout
  },
  {
    path: '',
    redirect: '/login'
  },
  {
    path: '/before',
    component: Before,
    children: [
      {
        path: '/list', component: list
      },
      {
        path: '/gai', component: gai
      },
      {
        path: '/userlist', component: userlist
      },
      {
        path: '/usergai', component: usergai
      },
      {
        path: '/jing', component: Jing
      },
      {
        path: '/fabu', component: fabu
      },
      {
        path: '/user', component: user
      }
    ]
  },
  {
    path: '/test',
    component: Test
    // redirect
  },
  {
    path: '*',
    component: page404
  }
]

const router = new VueRouter({
  routes
})

export default router
